package com.mobileshop.android.controller;

import java.util.HashMap;
import java.util.List;

import com.jfinal.core.Controller;
import com.mobileshop.model.YCategory;
import com.mobileshop.model.YProduct;

public class MainController extends Controller{
	
	public void index(){
		HashMap<YCategory, List<YCategory>> data=YCategory.dao.findMap();
		List<YProduct> products=YProduct.dao.find("select * from t_product ");
		setAttr("gory", data);
		setAttr("products", products);
		render("/androidviews/index.html");
	}
	
	public void listproduct(){
		String categorycode=getPara("categorycode");
		List<YProduct> products=YProduct.dao.findByCategory(categorycode);
		setAttr("products", products);
		render("/androidviews/products.html");
		
	}
	
}
